Capturing
Joystick Input
Most of the
code controlling the joystick is in the main window function. In the following
portion of the message handler, the application calls joySetCapture
case WM_CREATE:
if(joySetCapture(hWnd, JOYSTICKID1, NULL, FALSE))
{
MessageBeep(MB_ICONEXCLAMATION);
MessageBox(hWnd, "Couldn't capture the joystick.", NULL,
MB_OK | MB_ICONEXCLAMATION);
PostMessage(hWnd,WM_CLOSE,0,0L);
}
break;